package cn.itcast.service.impl;

import javax.annotation.Resource;

import cn.itcast.test.ItcastResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import cn.itcast.dao.PersonDao;
import cn.itcast.service.PersonService;


public class PersonServiceBean implements PersonService {
	@ItcastResource
	private PersonDao personDao;
	private String name;
	
	public void setPersonDao(PersonDao personDao) {
		this.personDao = personDao;
	}
	
	public PersonServiceBean() {}
	
	public PersonServiceBean(PersonDao personDao, String name) {
		this.personDao = personDao;
		this.name = name;
	}
	
	@Override
	public void save() {
		// System.out.println(name);
		personDao.add();
	}
}
